Skip to content

🎈 Add Minecraft pc 1.21.9/1.21.10 data#1096

Merged
extremeheat merged 18 commits intomasterfrom
pc-1_21_9
Jan 25, 2026
Merged

🎈 Add Minecraft pc 1.21.9/1.21.10 data#1096
extremeheat merged 18 commits intomasterfrom
pc-1_21_9

Conversation

@rom1504bot
Copy link
Collaborator

@rom1504bot rom1504bot commented Oct 4, 2025

This automated PR sets up the relevant boilerplate for Minecraft pc version 1.21.9. Fixes #1095.

Related:

  • You can help contribute to this PR by opening a PR against this pc-1_21_9 branch instead of master.

@richnetdesign
Copy link
Contributor

I can't reproduce this error when running cd tools/js && npm test locally from this branch. Also my # of tests run don't match the github actions output.

Locally I get

1663 passing (1m)
1 pending

Github says

1690 passing (2m)
1 pending
1 failing

  1. protocol yaml
    should be valid and in sync with json:
    Error: 1.21.8 (1.21.8) / protocol.json is desynced from yaml, please run 'npm run build'

I could use some advice on how to ensure my local environment testing matches the CI/CD

@extremeheat
Copy link
Member

Your local branch is out of date, it's not listing all the tests (1663 vs 1690). I just merged master into here, pull the latest commit and run it again

@richnetdesign
Copy link
Contributor

richnetdesign commented Dec 5, 2025

Ok thanks. I regenerated the json and it found .8 and .9 were out of sync. I can submit a PR to fix.

It looks like the bot changed the .8 proto.yaml in this branch even though this PR is for .9. Is that correct?

This bot updates to .8 are here.
dd11e71

PR to fix is here
#1117

fixes 1.21.8 and 1.21.9

Co-authored-by: Rich Young <code@richyoung.ca>
@extremeheat
Copy link
Member

* Add loginPacket.json for Minecraft 1.21.9

Adds the missing loginPacket.json file needed for 1.21.9 server support.
Copied from 1.21.3 as they share similar login packet structure.

* adding ci.yml

* Refactor CI workflow for improved structure and clarity
@atiweb
Copy link

atiweb commented Jan 13, 2026

🐛 Protocol Issues Found in 1.21.9 protocol.json

I've been testing the 1.21.9 data with a vanilla 1.21.9 server and found two critical packet definition errors that cause connection failures:

1. packet_spawn_position - Missing dimension field

Current (incorrect):

"packet_spawn_position": [
  "container",
  [
    { "name": "location", "type": "position" },
    { "name": "angle", "type": "f32" }
  ]
]

Should be (same as 1.21.8 and 1.21.11):

"packet_spawn_position": [
  "container",
  [
    { "name": "dimension", "type": "string" },
    { "name": "location", "type": "position" },
    { "name": "yaw", "type": "f32" },
    { "name": "pitch", "type": "f32" }
  ]
]

Evidence: Server sends 37 bytes but only 13 were being read. Buffer analysis shows:

  • VarInt length prefix
  • String "minecraft:overworld" (19 chars)
  • Position (8 bytes)
  • yaw + pitch floats (8 bytes)

2. packet_spawn_entity - Wrong format for movement data

Current (incorrect):

"packet_spawn_entity": [
  "container",
  [
    { "name": "entityId", "type": "varint" },
    { "name": "objectUUID", "type": "UUID" },
    { "name": "type", "type": "varint" },
    { "name": "x", "type": "f64" },
    { "name": "y", "type": "f64" },
    { "name": "z", "type": "f64" },
    { "name": "pitch", "type": "i8" },
    { "name": "yaw", "type": "i8" },
    { "name": "headPitch", "type": "i8" },
    { "name": "objectData", "type": "varint" },
    { "name": "velocityX", "type": "i16" },
    { "name": "velocityY", "type": "i16" },
    { "name": "velocityZ", "type": "i16" }
  ]
]

Should be (same as 1.21.8):

"packet_spawn_entity": [
  "container",
  [
    { "name": "entityId", "type": "varint" },
    { "name": "objectUUID", "type": "UUID" },
    { "name": "type", "type": "varint" },
    { "name": "x", "type": "f64" },
    { "name": "y", "type": "f64" },
    { "name": "z", "type": "f64" },
    { "name": "movement", "type": "restBuffer" }
  ]
]

Error: PartialReadError: Read error for undefined : undefined at Object.reader [as i16] - trying to read velocity fields that don't exist in the actual packet data.


✅ Test Results After Fixes

After applying both fixes locally, a mineflayer bot successfully:

  • Logged into vanilla 1.21.9 server
  • Spawned without errors
  • Read position correctly: Vec3 { x: 127.5, y: 70, z: -40.5 }

These packets should match the 1.21.8 format since protocol version 773 (1.21.9/1.21.10) didn't change these specific packet structures.

@atiweb
Copy link

atiweb commented Jan 13, 2026

🔧 Ready-to-Apply Patch for Protocol Fixes

Following up on the bug report above, here's the exact patch that fixes both issues in data/pc/1.21.9/protocol.json:

diff --git a/data/pc/1.21.9/protocol.json b/data/pc/1.21.9/protocol.json
--- a/data/pc/1.21.9/protocol.json
+++ b/data/pc/1.21.9/protocol.json
@@ -4730,32 +4730,8 @@
               "type": "f64"
             },
             {
-              "name": "pitch",
-              "type": "i8"
-            },
-            {
-              "name": "yaw",
-              "type": "i8"
-            },
-            {
-              "name": "headPitch",
-              "type": "i8"
-            },
-            {
-              "name": "objectData",
-              "type": "varint"
-            },
-            {
-              "name": "velocityX",
-              "type": "i16"
-            },
-            {
-              "name": "velocityY",
-              "type": "i16"
-            },
-            {
-              "name": "velocityZ",
-              "type": "i16"
+              "name": "movement",
+              "type": "restBuffer"
             }
           ]
         ],
@@ -7304,12 +7280,20 @@
         "packet_spawn_position": [
           "container",
           [
+            {
+              "name": "dimension",
+              "type": "string"
+            },
             {
               "name": "location",
               "type": "position"
             },
             {
-              "name": "angle",
+              "name": "yaw",
+              "type": "f32"
+            },
+            {
+              "name": "pitch",
               "type": "f32"
             }
           ]

Summary of Changes:

Packet Current (broken) Fixed
packet_spawn_entity 8 explicit fields (pitch, yaw, headPitch, objectData, velocityX/Y/Z) movement: restBuffer
packet_spawn_position 2 fields (location, angle) 4 fields (dimension, location, yaw, pitch)

Verification

  • ✅ Tested with vanilla Minecraft 1.21.9 server (downloaded from Mojang)
  • ✅ Bot successfully connected and received spawn position
  • ✅ Entity spawning works correctly with mineflayer

To apply: git apply protocol-fix.patch or manually edit the file.

cc @rom1504 @extremeheat

SuperGamerTron and others added 9 commits January 18, 2026 20:46
* 🎈 Add Minecraft pc 1.21.10 data

* [Auto] Apply generated data from PrismarineJS/minecraft-data-generator#61

* Add loginPacket.json

* Update features.json

* Update protocol

* 1.21.9

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* Fix packet_tracked_waypoint

* Fix packet_tracked_waypoint

* Fix packet_tracked_waypoint
@extremeheat extremeheat changed the title 🎈 Add Minecraft pc 1.21.9 data 🎈 Add Minecraft pc 1.21.9/1.21.10 data Jan 25, 2026
boundingBoxMax: position
isStart: bool

Node:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rename, "PathNode"

Comment on lines +1093 to +1094
if chicken_variant: varint
if optional_global_pos: ["option", "GlobalPos"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

backcheck older versions for these changes

Comment on lines -1685 to -1686
velocityY: i16
velocityZ: i16
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rename velocityX/Y/Z with just 'velocity' on all versions

Comment on lines +2060 to +2071
# MC: ClientboundDebugBlockValuePacket
packet_debug_block_value:
blockPos: position
update: DebugSubscriptionUpdate
# MC: ClientboundDebugChunkValuePacket
packet_debug_chunk_value:
chunkPos: packedChunkPos
update: DebugSubscriptionUpdate
# MC: ClientboundEntityEntityValuePacket
packet_debug_entity_value:
entityId: varint
update: DebugSubscriptionUpdate
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

backportable?

x: f64
y: f64
z: f64
center: vec3f64
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same, backport all to 'center'

@extremeheat extremeheat merged commit c260971 into master Jan 25, 2026
5 checks passed
@extremeheat extremeheat deleted the pc-1_21_9 branch January 25, 2026 23:52
@extremeheat
Copy link
Member

/makerelease

@rom1504bot rom1504bot mentioned this pull request Jan 25, 2026
atiweb added a commit to atiweb/minecraft-data that referenced this pull request Jan 26, 2026
Add minecraft-data support for version 1.21.11 'Mounts of Mayhem':

New Content:
- 4 new entities (camel_husk, nautilus, parched, zombie_nautilus)
- 1 new mob effect (breath_of_the_nautilus)
- 16 new items (spears, nautilus armor, spawn eggs)

Files added:
- data/pc/1.21.11/ directory with all data files
- dataPaths.json updated with 1.21.11 entry

Note: This PR focuses only on 1.21.11 as 1.21.9/1.21.10 support was
already merged via PR PrismarineJS#1096.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support Minecraft PC 1.21.9

7 participants